//
//  DGDownloadTask.h
//  DGDownloader
//
//  Created by Jinxiao on 4/15/16.
//  Copyright © 2016 debugeek. All rights reserved.
//

#import <Foundation/Foundation.h>

@interface DGDownloadTask : NSObject

@property (readonly) NSString *identifier;

@property (readwrite, nonatomic, strong) NSURL *sourceURL;

@property (readonly) NSString *filePath;

@property (readwrite, nonatomic, strong) id userInfo;

- (void)start;

@property (readwrite, nonatomic, strong) NSError *lastError;

@property (readwrite, nonatomic, strong) NSDate *startDate;
@property (readwrite, nonatomic, strong) NSDate *finishDate;

@property (readwrite, nonatomic, strong) void (^progressive) (double progress);

@property (readwrite, nonatomic, strong) void (^completion) (NSString *filePath, NSError *error);

@end

@interface NSString (CDDownloadTask)

- (NSString *)identifierForDownloadTask;

@end
